﻿// Write an expression that calculates trapezoid's area by given sides a and b and height h.

using System;

class CalculateTrapezoidArea
{
    static void Main()
    {
        Console.Write("Enter a :");
        double a = double.Parse(Console.ReadLine());
        Console.Write("Enter b :");
        double b = double.Parse(Console.ReadLine());
        Console.Write("Enter h :");
        double h = double.Parse(Console.ReadLine());

        if ((a <= 0) || (b <= 0) || (h <= 0))
        {
            Console.WriteLine("You have entered wrong measures.");
        }
        else
        {
            double trapezoidArea = ((a + b) * h) / 2;
            Console.WriteLine("The trapezoid's area is : {0}", trapezoidArea);
        }
    }
}
